// const CONF = {
//     port: '5757',
//     rootPathname: '',
//     /**
//      * MySQL 配置
//     */
//     database: process.env.NODE_ENV
// }


let port = '5757'
// app 数据库
let mobuzDb
// 小程序 数据库
let mobuzWx

// 开发环境
if (process.env.NODE_ENV !== 'development') {
    // koa2 多数据源链接 (测试)
    mobuzDb = require('knex')({
        client: 'mysql',
        connection: {
            host: 'rm-wz91gcm0zb9z046f5go.mysql.rds.aliyuncs.com',
            port: 5601,
            user: 'mobuz',
            password: 'hrw5mCMcPk3D',
            database: 'mobuz',
            charset: 'utf8mb4'
        }
    })
    mobuzWx = require('knex')({
        client: 'mysql',
        connection: {
            host: 'rm-wz91gcm0zb9z046f5go.mysql.rds.aliyuncs.com',
            port: 5601,
            user: 'wx',
            password: 'c8FD4gv4OwxH',
            database: 'wx_mobuz',
            charset: 'utf8mb4'
        }
    })
} else {
    // koa2 多数据源链接 (测试)
    mobuzDb = require('knex')({
        client: 'mysql',
        connection: {
            host: 'rm-wz91gcm0zb9z046f5go.mysql.rds.aliyuncs.com',
            port: 5601,
            user: 'mobuz',
            password: 'hrw5mCMcPk3D',
            database: 'mobuz',
            charset: 'utf8mb4'
        }
    })
    mobuzWx = require('knex')({
        client: 'mysql',
        connection: {
            host: 'rm-wz91gcm0zb9z046f5go.mysql.rds.aliyuncs.com',
            port: 5601,
            user: 'wx',
            password: 'c8FD4gv4OwxH',
            database: 'wx_mobuz',
            charset: 'utf8mb4'
        }
    })
}

module.exports = {
    port,
    mobuzDb,
    mobuzWx
}

